module.exports = function rootAuth(req, res, next) {
	var targetFolderId = req.param('id');
	//var userId = req.session.user.id;
	
	var userid = req.param("userid");
	var passwd = req.param("passwd");
	
	var isAdmin = (sails.config.application.root.userid == userid && sails.config.application.root.passwd == passwd)
	
	
	console.log("======="+userid);

	/*Permission.findOneByFolderId(targetFolderId).exec(
			function foundPermission(err, permission) {

				// Unexpected error occurred-- skip to the app's default error
				// (500) handler
				if (err)
					return next(err);

				// No permission exists linking this user to this folder. Maybe
				// they got removed from it? Maybe they never had permission in
				// the first place? Who cares?
				if (!permission)
					return res.redirect('/notAllowed');

				// OK, so a permission was found. Let's be sure it's a "write".
				if (permission.type !== 'write')
					return res.redirect('/notAllowed');

				// If we made it all the way down here, looks like everything's
				// ok, so we'll let the user through
				next();
			});*/
}